package pojo;

import java.util.ArrayList;
import java.util.List;

public class ListBook {
	private List<Book> list = new ArrayList<Book>();

	public ListBook()
	{
		
	}
	
	public void set(List<Book> l)
	{
		list=l;
	}
	
	public List<Book> get()
	{
		return list;
	}
	
	public void add(Book b)
	{
		if(list.size()<10)
		{
			list.add(b);
		}
		else
		{
			Book t= list.get(0);
			Book t2;
			for(int i=1;i<5;i++)
			{
				t2=list.get(i);
				list.set(i, t);
				t=t2;
			}
			list.set(0,b);
		}	
	}
	
	
}
